import Vue from 'vue'
import VueRouter from 'vue-router'
<<<<<<< HEAD
<<<<<<< HEAD
import Header from '@/components/header'
=======
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5

=======
import Footer from '@/components/footer.vue'
>>>>>>> 61d95511f5bb548966870409910cdf315f439697
Vue.use(VueRouter)

const routes = [
  {
<<<<<<< HEAD
    path: '/',
    redirect: '/home'
<<<<<<< HEAD
  },
  {
    path: '/home',
    name: 'home',
    // which is lazy-loaded when the route is visited.
<<<<<<< HEAD
    components: {
      default: () => import('@/views/home/index'),
      header: Header
    }
  },
  {
    path: '/search',
    name: 'search',
    // which is lazy-loaded when the route is visited.
    component: () => import('@/views/search/index')
  },
  {
    path: '/list',
    name: 'list',
    // which is lazy-loaded when the route is visited.
    component: () => import('@/views/list/index')
  },
  {
    path: '/detail',
    name: 'detail',
    // which is lazy-loaded when the route is visited.
    component: () => import('@/views/detail/index')
  },
  {
    path: '*',
    name: 'notFound',
    // which is lazy-loaded when the route is visited.
    component: () => import('@/views/notFound/index')
=======
  },
  {
    path: '/home', // 地址栏输入的网址
    name: 'home', // 起的名字 -- 命名路由
    // 当前地址栏输入这个网址时，你需要显示的是哪一个页面
    // 路由的懒加载
    components: {
      default: () => import('@/views/home/index.vue'),
      footer: Footer
    }
  },
  {
    path: '/cart',
    name: 'cart',
    components: {
      default: () => import('@/views/cart/index.vue'),
      footer: Footer
    }
=======
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/login',
    name: 'login',
    // component: () => import('@/views/login/index.vue')
    components: {
      default: () => import('@/views/login/index')
    }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/register/index.vue')
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
  },
  {
    path: '/user',
    name: 'user',
    components: {
<<<<<<< HEAD
      default: () => import('@/views/user/index.vue'),
      footer: Footer
=======
      default: () => import('@/views/user/index')
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
    }
  },
  {
    path: '/edituser',
    name: 'edituser',
    components: {
<<<<<<< HEAD
      default: () => import('@/views/user/edit.vue')
    }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/register/index.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/detail/:proid',
    name: 'detail', // 命名路由
    component: () => import('@/views/detail/index.vue')
  },
  {
    path: '/order/:orderid',
    name: 'order',
    component: () => import('@/views/order/index.vue')
  },
  {
    path: '/addresslist',
    name: 'addresslist',
    component: () => import('@/components/Addresslist.vue')
  },
  {
    path: '/products',
    name: 'products',
    component: () => import('@/views/products/index.vue')
  },
  {
    path: '/addressadd',
    name: 'addressadd',
    component: () => import('@/components/AddressAdd.vue')
  },
  {
    path: '/addressmodify/:addressid',
    name: 'addressmodify',
    component: () => import('@/components/AddressModify.vue')
  },
  {
    path: '*',
    name: 'notfound',
    component: () => import('@/views/notfound/index.vue')
>>>>>>> 61d95511f5bb548966870409910cdf315f439697
=======
      default: () => import('@/views/user/edit')
    }
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
    path: '/category', // 网址上输入的地址
    name: 'category', // 命名路由
    // 路由懒加载
    component: () => import('@/views/category/index.vue')
  },
  {
    path: '/pro', // 网址上输入的地址
    name: 'pro', // 命名路由
    // 路由懒加载
    component: () => import('@/views/pro/index.vue')
  },
  {
    path: '/product', // 网址上输入的地址
    name: 'product', // 命名路由
    // 路由懒加载
    component: () => import('@/views/product/index.vue')
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
